<?php
/**
 * Created by PhpStorm.
 * User: 戎大富
 * Date: 2019/9/18
 * Time: 14:41
 */
namespace app\api\controller;
use think\Db;
use org\Qiniu;
class Timing extends Base {

    /**
     * 实时更新
     */
    public function videoNum() {
        set_time_limit(0);
//        $res = Db::table('up_u_user')->where('user_id','>',0)
//            ->setField('user_phone_auth',2);
//        dump($res);
//        for($i=1;$i<=5;$i++){
//            $data = Db::table('up_pp_video')
//                ->where('v_status',1)
//                ->field('v_id')
//                ->select();
//            if($data){
//                foreach ($data as $k => $v){
//                    $num = rand(1000,10000);
//                    Db::table('up_pp_video')->where('v_id',$v['v_id'])->setField('v_round',$num);
//                }
//            }
//            sleep(5);
//        }
        exit();
    }
    /**
     * 下载
     */
    public function dowload() {
        $agent = strtolower($_SERVER['HTTP_USER_AGENT']);
        if(strpos($agent, 'iphone') || strpos($agent, 'ipad'))
        {
            echo '敬请期待！';die;
            echo "<script> location.href='https://itunes.apple.com/cn/app/id1516439349'; </script>";
        }else{
           echo "<script> location.href='http://banma.xuanwumobile.com/banma.apk'; </script>";
        }

    }


}